/**
 * 
 */
package com.es.dao;


import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;

import org.apache.log4j.Logger;

import com.es.dao.factory.SqlMapClientFactory;
import com.es.exception.dao.ESDataAccessException;
import com.es.model.Lead;
import com.es.model.Property;
import com.es.model.Value;
import com.es.util.ProjectConstant;
import com.ibatis.sqlmap.client.SqlMapClient;


/**
 * @author Bushra Nazir
 *
 */
public class ValueDAO extends BaseDAO {

	private static final Logger log = Logger.getLogger(ValueDAO.class);




	/*
	 * @author Bushra
	 * @param Property
	 * @return List<Values>
	 * returns a list of values of a property>
	 */

	public List<Value> getValues(Property property) {

		List<Value> values = new ArrayList<Value>();

		log.info("INSIDE getValues()" );


		SqlMapClient sqlMap =  SqlMapClientFactory.getSqlMapClient();

		try {

			values = (ArrayList) sqlMap.queryForList(
					"value.selectValuesByPropertyId", property.getPropertyId());

			return values;

		} catch (Exception e) {
			log.error(e);
			throw new ESDataAccessException(e);
		}
	}

}
